// 采样台账

import request from '@/utils/request'

// 采样台账
export function getBill(params) {
  return request({
    url: '/bill.do?action=list&type=SampleBill&areaCode=440000&delayBigDataQuery=true',
    method: 'post',
    params
  })
}

// 采样台账 详情
export function getBillDetail(id) {
  return request({
    url: '/bill.do?action=get&buildControls=needBuildBillFile,BUILD_SAMPLE_DETAIL,BUILD_FAST_CHECK_ENT',
    method: 'post',
    params: { id }
  })
}

// 获取检测报告
export function getBillReport(relationBillId) {
  return request({
    url: '/report/report.do?action=getByRelationBillId',
    method: 'post',
    params: { relationBillId }
  })
}

// 作废
export function cancelBill(id) {
  return request({
    url: `/bill.do?type=SampleBill&actionCode=ACTION_DATA_CYTZ_DJC_TO_ZF&action=transform&id=${id}`,
    method: 'post'
  })
}

// 删除草稿
export function deleteDraft(id) {
  return request({
    url: `/bill.do?action=transform&type=SampleBill&actionCode=ACTION_DATA_CYTZ_SC&id=${id}&actionId=2304101900535860000`,
    method: 'post'
  })
}

// 获取草稿详情-编辑
export function getDraftOfEdit(id) {
  return request({
    url: `/bill.do?action=get&id=${id}&buildControls=needBuildBillFile,BUILD_SAMPLE_DETAIL,BUILD_FAST_CHECK_ENT`,
    method: 'post'
  })
}
